<!--根据这个页单独设置样式-->
<style>
    .table-responsive{overflow-x: inherit}
    td{ vertical-align: middle!important;}
    .pagination{ margin:0!important;}
    .flot{float: left}
    .rlot{float: right}
</style>
<script type="text/ng-template" id="addExpress.html">
    <div class="modal-header">
        <h3 class="modal-title">添加</h3>
    </div>
    <div class="modal-body">
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>名称</label>
                        <input type="text" class="form-control"
                               ng-model="vm.name"  required >
                    </div>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>别名</label>
                        <input type="text" class="form-control"
                               ng-model="vm.alias"  required >
                    </div>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>code</label>
                        <input type="text" class="form-control"
                               ng-model="vm.code"  required >
                    </div>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>sort</label>
                        <input type="text" class="form-control"
                               ng-model="vm.sort"  required >
                    </div>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>状态</label>
                        <!--<input type="text" class="form-control"-->
                               <!--ng-model="vm.status"  required >-->
                        <div>
                            <label class="i-switch m-t-xs m-r">
                                <input type="checkbox"
                                       ng-true-value="'1'"
                                       ng-false-value="'0'"
                                       ng-model="vm.status" >
                                <i></i>
                            </label>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-sm btn-danger" ng-click="cancel()">Cancel</button>
        <button class="btn btn-sm btn-success" ng-click="ok()">OK</button>
    </div>
</script>
<script type="text/ng-template" id="upExpress.html">
    <div class="modal-header">
        <h3 class="modal-title">编辑</h3>
    </div>
    <div class="modal-body">
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>名称</label>
                        <input type="text" class="form-control"
                               ng-model="vm.name"  required >
                    </div>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>别名</label>
                        <input type="text" class="form-control"
                               ng-model="vm.alias"  required >
                    </div>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>code</label>
                        <input type="text" class="form-control"
                               ng-model="vm.code"  required
                                disabled>
                    </div>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>sort</label>
                        <input type="text" class="form-control"
                               ng-model="vm.sort"  required >
                    </div>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>状态</label>
                        <div>
                            <label class="i-switch m-t-xs m-r">
                                <input type="checkbox"
                                       ng-true-value="'1'"
                                       ng-false-value="'0'"
                                       ng-model="vm.status" >
                                <i></i>
                            </label>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-sm btn-danger" ng-click="cancel()">Cancel</button>
        <button class="btn btn-sm btn-success" ng-click="ok()">OK</button>
    </div>
</script>
<div>
    <div class="bg-light lter b-b wrapper-md">
        <h1 class="m-n font-thin h3">快递列表
            <button class="btn btn-sm pull-right btn-success" ng-click="model.open()">添加</button>
        </h1>
        <button class="btn btn-sm btn-success" ng-if="data.status==0" ng-click="ctrl.vm.enable(data.id)">启用</button>
    </div>
    <div class="padder-md m-b-none m-t" style="padding-top: 0">
        <div class="panel panel-default">
            <div class="panel-heading">快递列表</div>

            <div class="table-responsive">
                <table class="table table-striped b-t b-light">
                    <thead>
                    <tr>
                        <th>id</th>
                        <th>名称</th>
                        <th>别名</th>
                        <th>code</th>
                        <th>排序</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="data in ctrl.vm.data">
                        <td>{{data.id}}</td>
                        <td>{{data.name}}</td>
                        <td>{{data.alias}}</td>
                        <td>{{data.code}}</td>
                        <td>{{data.sort}}</td>
                        <td>
                            <span class="label bg-success" ng-if="data.status==1">启用</span>
                            <span class="label bg-danger" ng-if="data.status==0">禁用</span>
                        </td>
                        <td>
                            <button class="btn btn-sm btn-success" ng-if="data.status==0" ng-click="ctrl.vm.enable(data.id)">启用</button>
                            <button class="btn btn-sm btn-danger" ng-if="data.status==1" ng-click="ctrl.vm.disable(data.id)">禁用</button>
                            <button class="btn btn-sm btn-primary" ng-click="model.open1(data)">编辑</button>
                        </td>
                    </tr>
                    <tr ng-if="!ctrl.vm.data.length">
                        <td colspan="12" class="text-center">暂无数据！</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>